//
//  MJCompostButtton.swift
//  新浪微博
//
//  Created by MaJi on 16/4/17.
//  Copyright © 2016年 MaJi. All rights reserved.
//

import UIKit
private let imageW:CGFloat = 80
class MJCompostButtton: UIButton {

    var compostItem:MJComposeItem? {
        didSet{
            setTitle(compostItem?.title, forState: .Normal)
            setImage(UIImage(named: compostItem?.icon ?? ""), forState: .Normal)
        }
    }
    override func titleRectForContentRect(contentRect: CGRect) -> CGRect {
        return CGRect(x: 0, y: imageW, width: imageW, height: contentRect.size.height - imageW)
    }
    override func imageRectForContentRect(contentRect: CGRect) -> CGRect {
        return CGRect(x: 0, y: 0, width: imageW, height: imageW)
    }
}
